function togglePwd() {
  const pwdInput = document.getElementById('pwd');
  const icon = document.getElementById('pwd-icon');
  if (pwdInput.type === 'password') {
    pwdInput.type = 'text';
    icon.classList.replace('bi-eye-fill', 'bi-eye-slash-fill');
  } else {
    pwdInput.type = 'password';
    icon.classList.replace('bi-eye-slash-fill', 'bi-eye-fill');
  }
}

// —— 自动隐藏错误提示 —————————————
window.addEventListener('DOMContentLoaded', () => {
  const err = document.getElementById('error-msg');
  if (err) {
    setTimeout(() => {
      // 渐隐效果可选，简单起见直接隐藏：
      err.style.display = 'none';
    }, 3000);
  }
});